<?php



namespace App\Http\Requests\ApiV2;

use App\Http\Requests\Backend\BaseRequest;
use Illuminate\Support\Facades\Auth;

class FileRequest extends BaseRequest
{
    public function rules()
    {
        return [
            'title' => 'required|max:120',

        ];
    }

    public function messages()
    {
        return [
            'title.required' => __('请输入文件标题'),

        ];
    }

    public function filldata()
    {

        return [
            'user_id'=>Auth::id(),
            'corp_id' =>(int) $this->header('corpid', 0),
            'category_id' => (int)$this->input('category_id'),
            'title' => (string)$this->input('title'),
            'url' => (string)$this->input('url'),
            'path' =>(string) $this->input('path'),
            'extension' => (string)$this->input('extension', 0),
            'disk' =>(string) $this->input('disk'),
            'size' =>(int) $this->input('size'),

        ];
    }
}
